home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
tcpech1a
/
clsscree.cls
< prev
next >
Wrap
Text File
|
1999-08-31
|
19KB
|
582 lines
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "clsScreen"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
'Constants
Const MyModule = "clsScreen"
'Hooked Variables - for every one you add, add it to class_terminate as well
Public WithEvents mForm As Form
Attribute mForm.VB_VarHelpID = -1
Private WithEvents mToolbar As Toolbar
Attribute mToolbar.VB_VarHelpID = -1
Private mStatusBar As StatusBar
Attribute mStatusBar.VB_VarHelpID = -1
Private WithEvents mLstPlayers As ListBox
Attribute mLstPlayers.VB_VarHelpID = -1
Private WithEvents mLstGMs As ListBox
Attribute mLstGMs.VB_VarHelpID = -1
Private WithEvents mPicLights As PictureBox
Attribute mPicLights.VB_VarHelpID = -1
Private WithEvents mTxtInput As TextBox
Attribute mTxtInput.VB_VarHelpID = -1
Friend Sub Init()
'------------------------------------------------------------
'Initialize the screen settings
'------------------------------------------------------------
Const MyError = MyModule & "_" & "Init"
If Timings Then PerformanceStartTime MyError
On Error GoTo Err_Init
'------------------------------------------------------------
'Hook the form to capture its events
'------------------------------------------------------------
Load frmServer
Set mForm = frmServer
mForm_Load
'mForm.ControlBox = False
'------------------------------------------------------------
'Initialize the toolbar
'------------------------------------------------------------
Set mToolbar = mForm.Toolbar1
mToolbar.ImageList = mForm.imgListToolbar
mToolbar.Appearance = ccFlat
mToolbar.Wrappable = True
mToolbar.AllowCustomize = False
mToolbar.RestoreToolbar "Incarnation Server", "Settings", "mToolbar"
With mToolbar.Buttons
.Add , "Upload", "Upload Client", , "Upload"
.Add , "Record", "Record", , "Microphone"
.Add , "PlaySound", "Play", , "Sound"
.Add , "Time", "Time", , "Time"
.Add , "Weather", "Weather", , "Sun"
.Add , "Sessions", "Sessions", , "Sessions"
.Add , "Timings", "Timings", , "Timings"
.Add , "Monsters", "Spawning", , "Hamster"
.Add , "Warning", "Warning", , "Warning"
.Add , "Quit", "Shutdown", , "Stop"
End With
'Set up sub-buttons.
With mToolbar.Buttons(3)
.Style = tbrDropdown
.ButtonMenus.Add , "Recorded", "Recorded Message"
.ButtonMenus.Add , "Midi1", "Midi 1"
.ButtonMenus.Add , "Welcome", "Welcome"
End With
With mToolbar.Buttons(4)
.Style = tbrDropdown
.ButtonMenus.Add , , "Midnight"
.ButtonMenus.Add , , "01:00 AM"
.ButtonMenus.Add , , "02:00 AM"
.ButtonMenus.Add , , "03:00 AM"
.ButtonMenus.Add , , "04:00 AM"
.ButtonMenus.Add , , "05:00 AM"
.ButtonMenus.Add , , "06:00 AM"
.ButtonMenus.Add , , "07:00 AM"
.ButtonMenus.Add , , "08:00 AM"
.ButtonMenus.Add , , "09:00 AM"
.ButtonMenus.Add , , "10:00 AM"
.ButtonMenus.Add , , "12:00 AM"
.ButtonMenus.Add , , "Noon"
.ButtonMenus.Add , , "01:00 PM"
.ButtonMenus.Add , , "02:00 PM"
.ButtonMenus.Add , , "03:00 PM"
.ButtonMenus.Add , , "04:00 PM"
.ButtonMenus.Add , , "05:00 PM"
.ButtonMenus.Add , , "06:00 PM"
.ButtonMenus.Add , , "07:00 PM"
.ButtonMenus.Add , , "08:00 PM"
.ButtonMenus.Add , , "09:00 PM"
.ButtonMenus.Add , , "10:00 PM"
.ButtonMenus.Add , , "11:00 PM"
End With
With mToolbar.Buttons(5)
.Style = tbrDropdown
.ButtonMenus.Add , "Sun", "Sun"
.ButtonMenus.Add , "Rain", "Rain"
.ButtonMenus.Add , "Snow", "Snow"
End With
With mToolbar.Buttons(7)
.Style = tbrDropdown
.ButtonMenus.Add , "Display", "Display To Screen"
.ButtonMenus.Add , "File", "Write To File"
.ButtonMenus.Add , , "-"
.ButtonMenus.Add , "TurnOn", "Turn On Timings"
.ButtonMenus.Add , "TurnOff", "Turn Off Timings"
End With
'------------------------------------------------------------
'Initialize the status bar
'------------------------------------------------------------
Set mStatusBar = mForm.StatusBar1
With mStatusBar
.Panels.Clear
.Panels.Add , "pnl1"
.Panels.Add , "pnl2"
.Panels.Add , "pnlTime"
Time = G.CurrentTime
End With
'------------------------------------------------------------
'Initialize the player list
'------------------------------------------------------------
Set mLstPlayers = mForm.lstPlayers
Set mLstGMs = mForm.lstGMs
mLstPlayers.Visible = True
mLstGMs.Visible = False
'------------------------------------------------------------
'Initialize the flashing lights
'------------------------------------------------------------
Set mPicLights = mForm.picLights
mPicLights.Width = 505
mPicLights.Height = 100
'mPicLights.DrawWidth = 4
mPicLights.FillStyle = 0
'------------------------------------------------------------
'Rearrange the controls on the form
'------------------------------------------------------------
mForm_Resize
'------------------------------------------------------------
'Initialize the input box
'------------------------------------------------------------
Set mTxtInput = mForm.txtInput
'------------------------------------------------------------
'Show the form
'------------------------------------------------------------
mForm.Visible = True
'------------------------------------------------------------
'End of procedure
'------------------------------------------------------------
If Timings Then PerformanceEndTime MyError
Exit Sub
Err_Init:
CScreen.DebugText = MyError & ": " & Err.Number & " - " & Err.Description
Resume Next
End Sub
Friend Property Let DebugText(ByVal s As String)
'------------------------------------------------------------
'Writes text to the server debug display
'------------------------------------------------------------
Dim chars As Long
Const MyError = MyModule & "_" & "DebugText"
If Timings Then PerformanceStartTime MyError
On Error GoTo Err_Init
If Right$(s, 2) = vbCrLf Then
'skip it
Else
s = s & vbCrLf
End If
'Update server debug display
With mForm.txtDebug
chars = Len(.Text)
If chars > 15000 Then
.Text = Right(.Text, 1000)
chars = Len(.Text)
End If
If Len(s) > 15000 Then
s = Right(s, 15000)
End If
.SelStart = chars
.SelText = Format(Now) & " " & s
.SelStart = Len(.Text)
End With
If Timings Then PerformanceEndTime MyError
Exit Property
Err_Init:
Debug.Print Err.Number & " - " & Err.Description
Resume Next
End Property
Friend Property Let OutputText(ByVal s As String)
'------------------------------------------------------------
'Writes text to the server output display
'------------------------------------------------------------
Dim chars As Long
Const MyError = MyModule & "_" & "OutputText"
If Timings Then PerformanceStartTime MyError
On Error GoTo Err_Init
If Right$(s, 2) = vbCrLf Then
'skip it
Else
s = s & vbCrLf
End If
'Update server debug display
With mForm.txtOutput
chars = Len(.Text)
If chars > 100000 Then
.Text = ""
chars = 0
'.Text = Right(.Text, 1000)
'chars = Len(.Text)
End If
If Len(s) > 80000 Then
s = Right(s, 80000)